﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using Service.BusinessLayer.Logic;
using Service.BusinessLayer.Entities;
using Service.DataAccess.DataAccessHelper;

namespace Service
{
    /// <summary>
    /// Summary description for WS_SoThuChi
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class WS_SoThuChi : System.Web.Services.WebService
    {
        XL_SoThuChi xlstc = new XL_SoThuChi();

        [WebMethod]
        public string LayDS()
        {
            string kq = "";
            kq = xlstc.LayDS().GetXml();
            return kq;
        }
        [WebMethod]
        public string LayDS_TheoNgayThuChi(DateTime NgayChi)
        {
            string kq = "";
            kq = xlstc.LayDS_TheoNgaychi(NgayChi).GetXml();
            return kq;
        }
        [WebMethod]
        public string LayDS_NgayBD_NgayKT(DateTime NgayBD, DateTime NgayKT)
        {
            string kq = "";
            kq = xlstc.LayDS_NgayBD_NgayKT(NgayBD,NgayKT).GetXml();
            return kq;
        }
        [WebMethod]
        public void Them(string SoChungTu, string MaCP, string DienGiai, DateTime NgayChi, float SoTien)
        {
            SoThuChi stc = new SoThuChi(SoChungTu,MaCP,DienGiai,NgayChi,SoTien);
            xlstc.them(stc);
        }
        [WebMethod]
        public void Sua(string SoChungTu, string MaCP, string DienGiai, DateTime NgayChi, float SoTien)
        {
            SoThuChi stc = new SoThuChi(SoChungTu, MaCP, DienGiai, NgayChi, SoTien);
            xlstc.sua(stc);
        }
        [WebMethod]
        public void Xoa(string mastc)
        {
            xlstc.xoa(mastc);
        }
        [WebMethod]
        public string SelectSQL(string lenh_sql)
        {
            string kq = "";
            Helper help = new Helper();
            kq = help.SelectQueryByText(lenh_sql).GetXml();
            return kq;
        }
    }
}
